#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include <string_view>
#include<winsock.h>

#pragma comment (lib, "ws2_32.lib")

#define MAX_CHARBUFFER 1024
#define BUFFER_MAXBYTE 1024

class TCPClient {
public:
    TCPClient();

    ~TCPClient();

    bool TCP_Connect(std::string_view Ip, int Port);

    bool Send(std::string_view);

    std::string Receive();

    void TCP_Close();


protected:
    WSADATA WsaData;
    SOCKET Sock;
    sockaddr_in SockAddr;
    char MsgBuffer[BUFFER_MAXBYTE];
    int TimeOut;

};

#endif // TCPCLIENT_H
